<template>
    <div class="container">
        <el-progress :percentage="percentage" :stroke-width="propJson.strokeWidth"
                     :striped="propJson.isStriped" :type="propJson.type"
                    :text-inside="propJson.isTextInside" :indeterminate="propJson.isIndeterminate"
                    :width="propJson.width" :show-text="propJson.isShowText" :striped-flow="propJson.stripedFlow"
                    :duration="propJson.duration" :ywuInfo="execPercentage"/>
    </div>
</template>

<script>
import {doThirdServiceValue} from "@/request/lowcode/thirdService";

export default {
    name: "PercentageComponent",
    props: ['propJson', 'commonParam'],
    data() {
        return {
            percentage: 0
        }
    },
    methods: {
        execThen(resValue, param) {
            this.percentage = parseInt(resValue);
        },
        execCatch(resValue) {

        }
    },
    computed: {
        async execPercentage() {
            if (this.propJson.editFlag) {
                return;
            }
            await doThirdServiceValue(this.propJson.actionInfo, this.commonParam, this.execThen, this.execCatch, null)
        }
    }
}
</script>

<style scoped lang="less">

</style>